package com.example.controller;

import com.example.entity.EmergencyRescue;
import com.example.ext.entity.ExtEmergencyRescue;
import com.example.service.EmergencyRescueService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by youkun on 2017/10/25.
 */
@RestController
public class EmergencyRescueController {


    @Autowired
    private EmergencyRescueService emergencyRescueService;

    @ApiOperation(value = "查询救援列表的信息",notes = "查询救援列表的信息")
    @RequestMapping(value="api/emergencyRescue/getList",method = RequestMethod.POST)
    Map<String,Object> getElevatorList(@RequestBody ExtEmergencyRescue extEmergencyRescue){

        return emergencyRescueService.queryList(extEmergencyRescue);
    }

    @ApiOperation(value = "查看救援的详情",notes = "查看救援的详情")
    @RequestMapping(value="/api/emergencyRescue/{id}",method = RequestMethod.POST)
    Map<String,Object> deleteById(@PathVariable(value = "id") String id) {

        return emergencyRescueService.queryById(id);
    }

    @ApiOperation(value = "救援新增",notes = "救援新增")
    @RequestMapping(value="/api/emergencyRescue/add",method = RequestMethod.POST)
    Map<String,Object> add(@RequestBody EmergencyRescue emergencyRescue) {

        return emergencyRescueService.add(emergencyRescue);
    }
}
